﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[ExecuteInEditMode]
public class LifeBlock : MonoBehaviour
{
    [SerializeField]
    private GameObject borderBound;
    [SerializeField]
    private GameObject borderMiddle;
    [SerializeField]
    private GameObject fill;

    public bool isBound;
    public bool isFill;

    private void Start()
    {
        SetLifeBlockState();
    }

    public void SetLifeBlockState()
    {
        borderBound.SetActive(isBound);
        borderMiddle.SetActive(!isBound);
        
        fill.SetActive(isFill);
    }
    
    public void SetLifeBlockState(bool isSetBound, bool isSetFill)
    {
        this.isBound = isSetBound;
        this.isFill = isSetFill;

        SetLifeBlockState();
    }

    public void SetBound(bool isSetBound)
    {
        this.isBound = isSetBound;

        SetLifeBlockState();
    }

    public void SetFill(bool isSetFill)
    {
        this.isFill = isSetFill;

        SetLifeBlockState();   
    }
}
